macro ( copy_files GLOBPAT DESTINATION )
  file ( GLOB COPY_FILES
    RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
    ${GLOBPAT}
    )
  add_custom_target ( ${name} ALL
    COMMENT "Copying files: ${GLOBPAT}"
    )

  foreach ( FILENAME ${COPY_FILES} )
    set ( SRC "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}" )
    set ( DST "${DESTINATION}/${FILENAME}" )

    add_custom_command (
      TARGET ${name}
      COMMAND ${CMAKE_COMMAND} -E copy ${SRC} ${DST}
      COMMAND ${CMAKE_COMMAND} -E echo "Copied file" ${DST}
      )
  endforeach( FILENAME )
endmacro( copy_files )
